<?php
/**
 * Alternate.php
 * 
 * @category   Naneau
 * @package    Naneau_View_Helper
 * @copyright  Copyright (c) 2007 Maurice Fonk - http://naneau.nl
 * @version    0.1
 */

/**
 * Naneau_View_Helper_Alternate
 * 
 * alternate between values
 *
 * @category   Naneau
 * @package    Naneau_View_Helper
 * @copyright  Copyright (c) 2007 Maurice Fonk - http://naneau.nl
 */
class Naneau_View_Helper_Alternate {
    /**
     * counter
     * @var int
     */
    private $_counter = -1;
    
    /**
     * alternate between values
     *
     * @param array $values
     */
    public function alternate(array $values) {
        $this->_counter++;
        return $values[($this->_counter % count($values))];
    }
}